<template>
  <div id="app">
    <router-view/>
    <navBar></navBar>
  </div>
</template>

<script>
  import navBar from '@/public/navBar'

  export default {
    name: 'App',
    components:{
        navBar
    },

    beforeCreate:function(){
      if(localStorage.login_info){
        this.$store.commit('add_user');
      } else {
        this.$router.push({path:'/login'});
      }
    }
  }
</script>

<style lang="less">
  @import "./style/base.less";
  @import "./style/var.less";
  #app{
    .full;
  }
</style>
